var ul = document.querySelector("#ul");
var but = document.querySelector("#img");
var ipt= document.querySelector("#input");


but.addEventListener('click',function(){
    //创建span标签
    var span = document.createElement('span');
    var span_text = document.createTextNode(ipt.value);
    span.appendChild(span_text);

    //创建button标签
    var button = document.createElement('button');
    var button_text = document.createTextNode('删除');
    button.appendChild(button_text);

    button.addEventListener('click',function(){
        ul.removeChild(this.parentNode)
    });


    //创建li标签
    var li = document.createElement('li');
    //把input和button追加到li标签中
    li.appendChild(span);
    li.appendChild(button);

    //然后在把li标签追加到ul列表中
    ul.appendChild(li);
});



var it = document.querySelector("#input-1");

it.addEventListener("mouseover",function (){
    it.style.opacity = 0.99;
});
it.addEventListener("mouseout",function (){
    it.style.opacity = 0.4;
});


